package com.ideazd.api.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;

/**
 * Token拦截器
 * @author 
 *
 */
public class AuthInterceptor implements Interceptor {
	
	public void intercept(Invocation ai) {
		Controller controller = ai.getController();
		/*UserInfo user = controller.getSessionAttr("user");
		String openid = user.getOpenid();
		System.out.println("openid---->"+openid);
	     if (!StringUtil.isEmpty(openid)){
	       ai.invoke();
		   System.out.println("After invoking " + ai.getActionKey());
	     } else {
	    	 String path = controller.getRequest().getContextPath();
	    	 controller.redirect(path + "/pay/Oauth?oauth_type="+ controller.getSessionAttr("oauth_type")+"&plan_id="+ controller.getSessionAttr("plan_id"));
	     }*/
	}
}
